package com.example.demo.mapper;

import com.example.demo.entity.Rule;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface RuleMapper {
    int insert(Rule rule);
    int updateById(Rule rule);
    int deleteById(@Param("id") Integer id);
    Rule selectById(@Param("id") Integer id);
    List<Rule> selectAll(@Param("menu") Integer menu);
    List<Rule> selectByRuleId(@Param("rule_id") Integer ruleId);
    int updateStatusById(@Param("id") Integer id, @Param("status") Integer status);
    Rule selectByName(@Param("name") String name);
    Rule selectByFrontpath(@Param("frontpath") String frontpath);
    // 获取权限菜单列表
    List<Map<String, Object>> selectRuleListByIds(@Param("ruleIds") List<Integer> ruleIds);
}
